﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aribaccio
{
    /// <summary>
    ///  定义返回数据结果[模型对象]
    /// </summary>
    /// <typeparam name="T">对象模型</typeparam>
    public class ResultModel<T> : Result
    {
        /// <summary>
        /// 存储模型数据对象
        /// </summary>
        public T? Data { get; set; }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public ResultModel() : base() { }
        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultData">数据模型对象</param>
        public ResultModel(T argResultData) : base() { this.Data = argResultData; }

        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultMsg">信息描述</param>
        public ResultModel(string argResultMsg) : base(argResultMsg) { }
        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultMsg">信息描述</param>
        /// <param name="argResultData">数据模型对象</param>
        public ResultModel(string argResultMsg, T argResultData) : base(argResultMsg) { this.Data = argResultData; }

        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultCode"></param>
        public ResultModel(ResultStatus argResultCode) : base(argResultCode) { }
        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultCode">状态代码</param>
        /// <param name="argResultMsg">信息描述</param>
        public ResultModel(ResultStatus argResultCode, string argResultMsg) : base(argResultCode, argResultMsg) { }
        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultCode">状态代码</param>
        /// <param name="argResultData">数据模型对象</param>
        public ResultModel(ResultStatus argResultCode, T argResultData) : base(argResultCode) { this.Data = argResultData; }
        /// <summary>
        /// 带参构造函数
        /// </summary>
        /// <param name="argResultCode">状态代码</param>
        /// <param name="argResultMsg">信息描述</param>
        /// <param name="argResultData">数据模型对象</param>
        public ResultModel(ResultStatus argResultCode, string argResultMsg, T argResultData) : base(argResultCode, argResultMsg) { this.Data = argResultData; }
    }
}
